package com.shop.user.api.api;

import com.shop.common.model.param.user.AddressInput;
import com.shop.common.util.excption.UserNotFoundException;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 *
 * @author zhoulk
 * @date: 2019年03月29日  23:49
 */

public interface IAddressApi {

    /**
     * @Function com.shop.user.api.api.IAddressApi.apiAddAddress
     * @Description //TODO 新增地址
     *
     * @param: address
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:54
     *
     **/
    @PostMapping("/address")
    String apiAddAddress(@RequestBody AddressInput address, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IAddressApi.apiGetAddress
     * @Description //TODO 查询地址
     *
     * @param: id
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:54
     *
     **/
    @GetMapping("/address")
    String apiGetAddress(Integer id);

    /**
     * @Function com.shop.user.api.api.IAddressApi.apiGetAddressList
     * @Description //TODO 查询地址列表
     *
     * @param: address
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:54
     *
     **/
    @GetMapping("/addressList")
    String apiGetAddressList(AddressInput address, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IAddressApi.apiUpdateAddress
     * @Description //TODO 更新地址
     *
     * @param: address
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:54
     *
     **/
    @PutMapping("/address")
    String apiUpdateAddress(@RequestBody AddressInput address, HttpServletRequest request);

    /**
     * @Function com.shop.user.api.api.IAddressApi.settingDefault
     * @Description //TODO 设置默认地址
     *
     * @param: id
     * @param: request
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:55
     *
     **/
    @RequestMapping("/settingDefault")
    String settingDefault(String id, HttpServletRequest request) throws UserNotFoundException;

    /**
     * @Function com.shop.user.api.api.IAddressApi.apiDeleteAddress
     * @Description //TODO 删除地址
     *
     * @param: id
     * @return java.lang.String
     * @errorCode //TODO
     *
     * @Author zhoulk
     * @Date 2019/3/29 23:55
     *
     **/
    @DeleteMapping("/address")
    String apiDeleteAddress(String id);
}
